package suse.hotel.admin.admin.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import suse.hotel.admin.admin.Service.HotelService;

@Controller
public class HotelController {
    @Autowired
    HotelService hotelService;
    @RequestMapping("/hotel-list")
    public String toHotelList(){
        return "hotel-list";
    }

    @RequestMapping("/listHotel")
    @ResponseBody
    public String selUsers(@RequestParam(defaultValue="1") int page, @RequestParam(defaultValue="10") int limit) {
        return hotelService.listHotels(page,limit);
    }
}
